Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix $file::changeTemplate() #6739

Draft
wants to merge 2 commits into
base: develop-minor
Choose a base branch
from

Conversation

distantnative
Copy link
Member

@distantnative distantnative commented Oct 14, 2024

Description

Summary of changes

  • Ensure that file template always gets written to and read from default language content file

Changelog

Fixes

  • Fixed file template wrongfully being written to secondary language content file

Ready?

  • In-code documentation (wherever needed)
  • Unit tests for fixed bug/feature
  • Tests and CI checks all pass

For review team

  • Add changes & docs to release notes draft in Notion

@distantnative distantnative added the type: bug 🐛 Is a bug; fixes a bug label Oct 14, 2024
@distantnative distantnative added this to the 4.5.0 milestone Oct 14, 2024
@distantnative distantnative self-assigned this Oct 14, 2024
@distantnative distantnative marked this pull request as ready for review October 15, 2024 14:41
@distantnative distantnative marked this pull request as draft October 15, 2024 14:44
@@ -367,6 +367,9 @@ public function testChangeTemplateMultilang()
$modified = $file->changeTemplate('b');

$this->assertSame('b', $modified->template());
$this->assertSame('b', $modified->content('default')->get('template')->value());
$this->assertSame('b', $modified->content('en')->get('template')->value());
$this->assertNull($modified->content('de')->get('template')->value());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bastianallgeier maybe you have an idea with your content class/caching knowledge why this still has a when a non-default language should never have a template field for a file?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this stage, I believe that we merge it with the default language content.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problem is that the default language has been updated to b, but the secondary language still seems to be stuck with a.

@bastianallgeier bastianallgeier modified the milestones: 4.5.0, 4.6.0 Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Is a bug; fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants